Source for file utils.php
Documentation is available at utils.php
* This file offers various utility functions and classes.
* @author Antoine d'Otreppe de Bouvette <a.dotreppe@aspyct.org>
* @license http://www.opensource.org/licenses/mit-license.php
* Returns the value held by an $array at a given $key, or $default
* if this $key does not exist.
* Loads an ini file using {@link parse_ini_file()}, merging its data
* with a parent ini file if "extends" is defined at the root of the ini file.
* "extends" value is the relative or absolute path to the extended file.
* "extends" will not appear in resulting array.
* Returns False on failure (file missing, unreadable or unparseable)
* @param string $filename
if ($extends[0] === '/') {
$path = realpath($dir . DIRECTORY_SEPARATOR . $extends);
if ($extendedData !== False) {
* Merges two two-dimensional arrays.
* If keys overlap, array1 will be overriden by array2.
* Both arrays are untouched.
foreach ($array2 as $key=> $subarray) {
$array1[$key] = $subarray;
|